package interpreter

import (
	"errors"
)

type IDataField interface {
	Name() string
	DataType() DataTypes
	GetString() (error,string)
	GetInt() (error, int)
}


type DataTypes int
const StringDataType DataTypes = 1
const IntDataType DataTypes = 2


type tIntField struct {
	name string
	value int
}

func newIntField(name string, value int) *tIntField {
	return &tIntField{
		name,value,
	}
}

func (me *tIntField) Name() string {
	return me.name
}

func (me *tIntField) DataType() DataTypes {
	return IntDataType
}

func (me *tIntField) GetString() (error,string) {
	return errors.New("not implemented"), ""
}

func (me *tIntField) GetInt() (error,int) {
	return nil, me.value
}


type tStringField struct {
	name string
	value string
}

func newStringField(name string, value string) *tStringField {
	return &tStringField{
		name,value,
	}
}

func (me *tStringField) Name() string {
	return me.name
}

func (me *tStringField) DataType() DataTypes {
	return StringDataType
}

func (me *tStringField) GetString() (error,string) {
	return nil, me.value
}

func (me *tStringField) GetInt() (error,int) {
	return errors.New("not implemented"), 0
}